package com.crm.util;

import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.crypto.hash.Sha256Hash;

public class EncryptUtils {
	public static final String encryptMD5(String source) {
		if (source == null) {
			source = "";
		}
		Sha256Hash hash = new Sha256Hash(source);
		return new Md5Hash(hash).toString();
	}
	
	@SuppressWarnings("static-access")
	public static void main(String[] args) {
		EncryptUtils utils = new EncryptUtils();
		// 21232f297a57a5a743894a0e4a801fc3
		// 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
		// http://localhost:8080/shiro/resource/css/images/bg_index.gif
		System.out.println(utils.encryptMD5(""));
	}
}
